home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MPW_TOOL / TOOLS / TOOLS_WI / ICON_8 / BENCH_FO / SHUFFLE.ICN < prev   
Text File  |  1990-04-06  |  669b  |  25 lines

  1. ############################################################################
  2. #
  3. #    Name:    shuffle.icn
  4. #
  5. #    Title:    Shuffle values
  6. #
  7. #    Author:    Ward Cunningham
  8. #
  9. #    Date:    June 10, 1988
  10. #
  11. ############################################################################
  12. #  
  13. #     The procedure shuffle(x) shuffles a string or list. In the case
  14. #  that x is a string, a corresponding string with the characters
  15. #  randomly rearranged is produced. In the case that x is a list,
  16. #  the values in the list are randomly rearranged.
  17. #  
  18. ############################################################################
  19.  
  20. procedure shuffle(x)
  21.    x := string(x)
  22.    every !x :=: ?x
  23.    return x
  24. end
  25.